﻿@model IEnumerable<string> 
@using res = Resource.Views.Admin.Admin;
@{YQBlog.General.GeneralConfigInfo ci = ViewBag.CI as YQBlog.General.GeneralConfigInfo;}
@section MenuInfo{
<ul> 
    <li>@Html.ActionLink("-"+ res.ManagementHome+" -", "Index", "Admin")</li>
    <li>@Html.ActionLink("-" + res.ContentManagement + " -", "AdminArticle", "Admin", new { tid = 1 }, null)</li>
    <li>@Html.ActionLink("-" + res.Configuration + " -", "AdminBaseConfig", "Admin")</li>
    <li class="selected">
        <span class="selected-arrow">&nbsp;</span>
        <a href="###">- @res.UserManagement -</a>
        <ul style="width:400px;">
            <li>@Html.ActionLink(res.Users, "AdminUserList", "Admin")</li>
            <li class="selected">@Html.ActionLink(res.Administrators, "AdminManagerList", "Admin")</li>
        </ul>
    </li>
</ul>
}

<div id="mainContent">
        <div id="leftBox">
          <div id="pagePath">
          <span class="location">@res.Administratorslist</span>
          </div>

          <div class="contentBox">
            <div class="contentBoxTop">
              <h3>@res.Administratorslist</h3>
            </div>
            <div class="innerContent">
              <form action="" method="post" name="form2" id="form2">
                <table class="sTable">
				<thead>
                  <tr>
                    <th></th>
                    <th><strong>ID</strong></th>
                    <th><strong></strong></th>
                    <th><strong></strong></th>
                    <th><strong></strong></th>
                    <th><strong>@res.Operating</strong></th>
                    </tr>
                </thead>
                  <tbody>

    @if ((Model as IEnumerable<string>).Count() > 0)
    {
        foreach (string item in Model)
        {
                  <tr class="oddRow" id="@item">
                    <td class="u_zeroCol">
                    </td>
                    <td class="u_firstCol"><a href="###">@item</a></td>
                    <td class="u_secondCol">
                    </td>
                    <td class="u_thirdCol">
                    </td>
                    <td  class="u_forthCol">
                    </td>
                    <td class="u_editItem">
                    @if(item!="admin")
                    {
                    <ul>
                      <li><a href="javascript:" onclick="RemoveAdminRole('@item')">@res.Removetheadministrator</a></li>
                      <li><a href="javascript:" onclick="Del('@item')">@res.Deleteaccount</a></li>
                    </ul>
                    }
                    </td>
                    </tr>
        }
    }
                </tbody>
                </table>
              </form>
            </div><!--end of #box-3-->
          </div>

      </div><!-- end of #leftBox -->
              
  </div><!-- end of #content -->
@section Js{
    <script src="@Url.Content("~/Scripts/jquery.pager.js")" type="text/javascript"></script>
    <script type="text/javascript">

        Del=function(user) {
            if (confirm("@(res.DeleteSelected_Tip)")) {

                $.post('/BlogAdmin/Admin/AdminDelUser', { user: user }, function (data) {
                    alert(data);
                    $('#' + user).fadeOut('fast', function () {
                        $(this).hide();
                    });
                });
            }
        }
        RemoveAdminRole = function (user) {
            if (confirm("@(res.Confirm)")) {
                $.post('/BlogAdmin/Admin/AdminRemoveUserFromRole', { user: user }, function (data) {
                    alert(data);
                    $('#' + user).fadeOut('fast', function () {
                        $(this).hide();
                    });
                });
            }
        }
    </script>
}
